package com.android.update;

import com.android.update.config.HookConfig;
import com.android.update.config.HookDB;
import com.android.update.intercept.InterceptUtils;
import com.android.update.per.PermissionsUtils;
import com.android.update.test.TestUtils;
import com.android.update.up.UpUtils;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

public class MainHook implements IXposedHookLoadPackage {


    @Override
    public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
        String packName = lpparam.packageName;
        XposedBridge.log("yj_hook_main->authorization+包名->" + packName);
        XposedBridge.log("yj_hook_main->authorization" + packName);
        XposedBridge.log("yj_hook_main->authorization->info->1111-》" + HookDB.getIntance().getData());
        XposedBridge.log("yj_hook_main->authorization->授权->1111-》" + HookConfig.getIntance().isPermissions());
        XposedBridge.log("yj_hook_main->authorization->激活->1111-》" + HookConfig.getIntance().isActivate());
        XposedBridge.log("yj_hook_main->authorization->test->1111-》" + HookConfig.getIntance().isTest());
        //权限控制
        PermissionsUtils.authorization(lpparam);

        UpUtils.authorization(lpparam);

        TestUtils.authorization(lpparam);

        InterceptUtils.authorization(lpparam);
    }


}
